home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / perlnt.zip / t / comp / special.nt < prev    next >
Text File  |  1993-07-25  |  970b  |  43 lines

  1. print "1..5\n";
  2.  
  3. #
  4. # test special variables and arrays that aren't tested elsewhere
  5. #
  6.  
  7. if (!defined($INC{'getopts.pl'})) {print "ok 1\n";} else {print "not ok 1\n";}
  8.  
  9. require 'getopts.pl';
  10.  
  11. if (defined($INC{'getopts.pl'})) {print "ok 2\n";} else {print "not ok 2\n";}
  12.  
  13. #
  14. # No way to send signal to process under NT (yet!)
  15. #
  16.  
  17. #sub handler {
  18. #    local($sig) = @_;
  19. #    print "Caught SIG$sig! Resetting to default\n";
  20. #    $SIG{$sig} = 'DEFAULT';
  21. #    $foo = "ok";
  22. #    goto done;
  23. #}
  24.  
  25. #$SIG{'INT'} = 'handler';
  26. #$foo = "not ok";
  27. #kill 'INT', $$;
  28. #done:
  29. #    if ($foo eq "ok") {print "ok 3\n";} else {print "not ok 3\n";}
  30.  
  31. #
  32. # test the $? special variable (exit status)
  33.  
  34. `ls -ls >nul: 2>&1`;
  35. if ($? == 1) {print "ok 3\n";} else {print "not ok 3 ($?)\n";}
  36.  
  37. `dir/w >nul: 2>&1`;
  38. if ($? == 0) {print "ok 4\n";} else {print "not ok 4 ($?)\n";}
  39.  
  40. system "dir/w >nul: 2>&1";
  41. if ($? == 0) {print "ok 5\n";} else {print "not ok 5 ($?)\n";}
  42.  
  43.